 						var searchParams;
						$(function(){
							//添加按钮事件
							$('#addhhPayConfig').on('click', function() {
								var node = businessTable.datagrid('getSelected');
								if (node) {
									var noded = pay_table.datagrid('getData');
									
									if(noded.total==0){
										openaddhhPayConfig(node.businessId);
									}else{
										layer.msg('一个商家只能有一条配置信息！', {
											time : 1000
										})
									}
								} else {
									layer.msg('请选择一条商家！', {
										time : 1000
									})
								}
							});
							//修改按钮事件
							$('#edithhPayConfig').on('click', function() {
								var node = pay_table.datagrid('getSelected');
								if (node) {
									openedithhPayConfig(node.businessId);
								} else {
									layer.msg('请选择一条数据！', {
										time : 1000
									})
								}
							});
							//删除按钮事件
							$('#delhhPayConfig').on('click', function() {
								delhhPayConfig();
							});
						});
						//Table表格数据源
						var pay_table = $('#pay_table').datagrid(BasicData.createDatagrid({  
							url : '',
							checkOnSelect:true,
							singleSelect:true,
							selectOnCheck:true,
							frozenColumns:[[
								{field:'ck',checkbox:false,hidden:true},
								{title:'businessId',field:'businessId',hidden:true}
							]],
							columns:[[
								{field:'wxModel',title:'微信支付模式',width:'10%',align:'center'
									,formatter : function(value, row, index) {
										if(value=="platform"){
											return '平台';
										}else if(value=="subMch"){
											return '子商户';
										}else if(value=="mchSerivce"){
											return '商户服务商模式';
										}else if(value=="mch"){
											return '普通商户';
										}
								}},
								{field:'aliModel',title:'支付宝支付模式',width:'10%',align:'center',
									formatter : function(value, row, index) { 
										if(value=="platform"){
											return '平台';
										}else if(value=="subMch"){
											return '子商户';
										}else if(value=="mchSerivce"){
											return '商户服务商模式';
										}else if(value=="mch"){
											return '普通商户';
										}
								}},
								{field:'wxAppId',title:'微信APPID',width:'10%',align:'center'},
								{field:'wxSecret',title:'微信APPSECRET',width:'10%',align:'center'},
								{field:'wxServiceMchId',title:'微信服务商商户号',width:'10%',align:'center'},
								{field:'wxMchId',title:'微信商户号',width:'10%',align:'center'},
								{field:'wxPartnerkey',title:'微信支付签名秘钥',width:'10%',align:'center'},
								{field:'aliAppId',title:'支付宝APPID',width:'10%',align:'center'},
								{field:'aliMchPrivate_key',title:'支付宝商户私钥',width:'10%',align:'center'},
								{field:'aliPublicKey',title:'支付宝公钥',width:'10%',height:'10%',align:'center'} 
							]],
							onDblClickRow:function(rowIndex, rowData){
							},
							 onClickRow : function(index, row){
							}
						}));  
						 
						//新增打开窗体
						function openaddhhPayConfig(businessId){
							layer.open({
								title : '新增',
								type : 2,
								btn : ['保存','关闭'],
								yes : function(index,layero) {
									var iframeWin = window[layero.find('iframe')[0]['name']];
									iframeWin.parentIframeName = window.name;
									iframeWin.$("#dataForm").submit();
								},
								btn2 : function(index, layero) {
								},
								area : [ '55%', '55%' ],
								content : rootpath + '/hhPayConfig/toEdit.do?businessId='+businessId
							});
						}
						 
					
						//编辑打开窗体
						function openedithhPayConfig(businessId){
							layer.open({
								title : '修改',
								type : 2,
								btn : ['保存','关闭'],
								yes : function(index,layero) {
									var iframeWin = window[layero.find('iframe')[0]['name']];
									iframeWin.parentIframeName = window.name;
									iframeWin.$("#dataForm").submit();
								},
								btn2 : function(index, layero) {
								},
								area : [ '55%', '55%' ],
								content : rootpath + '/hhPayConfig/toEdit.do?businessId='+businessId
							});
						}
						//删除
						function delhhPayConfig(){
							var node = businessTable.datagrid('getSelected');
							if (node) {
								$.ajax({
									cache : true,
									type : "POST",
									url : rootpath + '/hhPayConfig/delete.do',
									data : {
										businessId : node.businessId
									},
									success : function(data) {
										layer.msg('成功！', {
											icon : 1,
											time : 1000
										}, function() {
											//刷新列表
											pay_table.datagrid('reload');
										})
									}
								});
							}else {
								layer.msg('请选择一条数据！', {
									time : 1000
								})
							}
						}
						 
					 